<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Get an EJ analysis (demographic and environmental indicators) in or near a list of locations — ejamit • EJAM</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.4.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.4.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Get an EJ analysis (demographic and environmental indicators) in or near a list of locations — ejamit"><meta name="description" content="This is the main function in EJAM that runs the analysis.
It does essentially what the web app does, to analyze/summarize near a set of points,
or in a set of polygons from a shapefile, or in a list of Census Units like Counties."><meta property="og:description" content="This is the main function in EJAM that runs the analysis.
It does essentially what the web app does, to analyze/summarize near a set of points,
or in a set of polygons from a shapefile, or in a list of Census Units like Counties."><meta property="og:image" content="https://usepa.github.io/EJAM/logo.svg"></head><body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>


    <nav class="navbar navbar-expand-lg fixed-top bg-light" data-bs-theme="light" aria-label="Site navigation"><div class="container">

    <a class="navbar-brand me-2" href="../index.html">EJAM</a>

    <small class="nav-text text-warning me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Released version">2.32.0</small>


    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto"><li class="active nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li>
<li class="nav-item dropdown">
  <button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button>
  <ul class="dropdown-menu" aria-labelledby="dropdown-articles"><li><hr class="dropdown-divider"></li>
    <li><h6 class="dropdown-header" data-toc-skip>Overview for EJAM Users</h6></li>
    <li><a class="dropdown-item" href="../articles/0_whatis.html">What is EJAM</a></li>
    <li><a class="dropdown-item" href="../articles/0_webapp.html">Using EJAM</a></li>
    <li><hr class="dropdown-divider"></li>
    <li><h6 class="dropdown-header" data-toc-skip>For analysts using R</h6></li>
    <li><a class="dropdown-item" href="../articles/1_installing.html">Installing the EJAM R package</a></li>
    <li><a class="dropdown-item" href="../articles/2_quickstart.html">Quick Start Guide</a></li>
    <li><a class="dropdown-item" href="../articles/3_analyzing.html">Basics of Using EJAM for Analysis in RStudio</a></li>
    <li><a class="dropdown-item" href="../articles/4_advanced.html">Advanced Features</a></li>
  </ul></li>
<li class="nav-item"><a class="nav-link" href="../news/index.html">Changelog</a></li>
      </ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search">
 <input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li>
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/USEPA/EJAM/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li>
      </ul></div>


  </div>
</nav><div class="container template-reference-topic">
<div class="row">
  <main id="main" class="col-md-9"><div class="page-header">
      <img src="../logo.svg" class="logo" alt=""><h1>Get an EJ analysis (demographic and environmental indicators) in or near a list of locations</h1>
      <small class="dont-index">Source: <a href="https://github.com/USEPA/EJAM/blob/HEAD/R/ejamit.R" class="external-link"><code>R/ejamit.R</code></a></small>
      <div class="d-none name"><code>ejamit.Rd</code></div>
    </div>

    <div class="ref-description section level2">
    <p>This is the main function in EJAM that runs the analysis.
It does essentially what the web app does, to analyze/summarize near a set of points,
or in a set of polygons from a shapefile, or in a list of Census Units like Counties.</p>
    </div>

    <div class="section level2">
    <h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">ejamit</span><span class="op">(</span></span>
<span>  <span class="va">sitepoints</span>,</span>
<span>  radius <span class="op">=</span> <span class="fl">3</span>,</span>
<span>  radius_donut_lower_edge <span class="op">=</span> <span class="fl">0</span>,</span>
<span>  maxradius <span class="op">=</span> <span class="fl">31.07</span>,</span>
<span>  avoidorphans <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  quadtree <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  fips <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  shapefile <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  countcols <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  popmeancols <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  calculatedcols <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  subgroups_type <span class="op">=</span> <span class="st">"nh"</span>,</span>
<span>  include_ejindexes <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  calculate_ratios <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  extra_demog <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  need_proximityscore <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  infer_sitepoints <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  need_blockwt <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  thresholds <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="fl">80</span>, <span class="fl">80</span><span class="op">)</span>,</span>
<span>  threshnames <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="va">names_ej_pctile</span>, <span class="va">names_ej_state_pctile</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="va">names_ej_supp_pctile</span>,</span>
<span>    <span class="va">names_ej_supp_state_pctile</span><span class="op">)</span><span class="op">)</span>,</span>
<span>  threshgroups <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="st">"EJ-US-or-ST"</span>, <span class="st">"Supp-US-or-ST"</span><span class="op">)</span>,</span>
<span>  updateProgress <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  updateProgress_getblocks <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  in_shiny <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  quiet <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  parallel <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  silentinteractive <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  called_by_ejamit <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  testing <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  showdrinkingwater <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  showpctowned <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  <span class="va">...</span></span>
<span><span class="op">)</span></span></code></pre></div>
    </div>

    <div class="section level2">
    <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>


<dl><dt id="arg-sitepoints">sitepoints<a class="anchor" aria-label="anchor" href="#arg-sitepoints"></a></dt>
<dd><p>data.table with columns lat, lon giving point locations of sites or facilities around which are circular buffers</p></dd>


<dt id="arg-radius">radius<a class="anchor" aria-label="anchor" href="#arg-radius"></a></dt>
<dd><p>in miles, defining circular buffer around a site point</p></dd>


<dt id="arg-radius-donut-lower-edge">radius_donut_lower_edge<a class="anchor" aria-label="anchor" href="#arg-radius-donut-lower-edge"></a></dt>
<dd><p>radius of lower edge of donut ring if analyzing a ring not circle</p></dd>


<dt id="arg-maxradius">maxradius<a class="anchor" aria-label="anchor" href="#arg-maxradius"></a></dt>
<dd><p>miles distance (max distance to check if not even 1 block point is within radius)</p></dd>


<dt id="arg-avoidorphans">avoidorphans<a class="anchor" aria-label="anchor" href="#arg-avoidorphans"></a></dt>
<dd><p>logical If TRUE, then where not even 1 BLOCK internal point is within radius of a SITE,
it keeps looking past radius, up to maxradius, to find nearest 1 BLOCK.
What EJScreen does in that case is report NA, right?
So, does EJAM really need to report stats on residents presumed to be within radius,
if no block centroid is within radius?
Best estimate might be to report indicators from nearest block centroid
which is probably almost always the one your site is sitting inside of,
but ideally would adjust total count to be a fraction of blockwt
based on what is area of circular buffer as fraction of area of block it is apparently inside of.
Setting this to TRUE can produce unexpected results, which will not match EJScreen numbers.
Note that if creating a proximity score, by contrast, you
instead want to find nearest 1 SITE if none within radius of this BLOCK.</p></dd>


<dt id="arg-quadtree">quadtree<a class="anchor" aria-label="anchor" href="#arg-quadtree"></a></dt>
<dd><p>(a pointer to the large quadtree object) created using indexblocks() which uses the SearchTree package.
Takes about 2-5 seconds to create this each time it is needed.
It can be automatically created when the package is attached via the .onAttach() function</p></dd>


<dt id="arg-fips">fips<a class="anchor" aria-label="anchor" href="#arg-fips"></a></dt>
<dd><p>optional FIPS code vector to provide if using FIPS instead of sitepoints to specify places to analyze,
such as a list of US Counties or tracts. Passed to <code><a href="getblocksnearby_from_fips.html">getblocksnearby_from_fips()</a></code></p></dd>


<dt id="arg-shapefile">shapefile<a class="anchor" aria-label="anchor" href="#arg-shapefile"></a></dt>
<dd><p>optional. A sf shapefile object or path to .zip, .gdb, or folder that has a shapefiles, to analyze polygons.
If in RStudio you want it to interactively prompt you to pick a file,
use shapefile=1 (otherwise it assumes you want to pick a latlon file).</p></dd>


<dt id="arg-countcols">countcols<a class="anchor" aria-label="anchor" href="#arg-countcols"></a></dt>
<dd><p>character vector of names of variables to aggregate within a buffer using a sum of counts,
like, for example, the number of people for whom a poverty ratio is known,
the count of which is the exact denominator needed to correctly calculate percent low income.</p></dd>


<dt id="arg-popmeancols">popmeancols<a class="anchor" aria-label="anchor" href="#arg-popmeancols"></a></dt>
<dd><p>character vector of names of variables to aggregate within a buffer using population weighted mean.</p></dd>


<dt id="arg-calculatedcols">calculatedcols<a class="anchor" aria-label="anchor" href="#arg-calculatedcols"></a></dt>
<dd><p>character vector of names of variables to aggregate within a buffer using formulas that have to be specified.</p></dd>


<dt id="arg-subgroups-type">subgroups_type<a class="anchor" aria-label="anchor" href="#arg-subgroups-type"></a></dt>
<dd><p>Optional (uses default). Set this to "nh" for non-hispanic race subgroups
as in Non-Hispanic White Alone, nhwa and others in names_d_subgroups_nh;
"alone" for race subgroups like White Alone, wa and others in names_d_subgroups_alone;
"both" for both versions. Possibly another option is "original" or "default"
Alone means single race.</p></dd>


<dt id="arg-include-ejindexes">include_ejindexes<a class="anchor" aria-label="anchor" href="#arg-include-ejindexes"></a></dt>
<dd><p>whether to try to include EJ Indexes (assuming dataset is available) - passed to <code><a href="doaggregate.html">doaggregate()</a></code></p></dd>


<dt id="arg-calculate-ratios">calculate_ratios<a class="anchor" aria-label="anchor" href="#arg-calculate-ratios"></a></dt>
<dd><p>whether to calculate and return ratio of each indicator to US and State overall averages - passed to <code><a href="doaggregate.html">doaggregate()</a></code></p></dd>


<dt id="arg-extra-demog">extra_demog<a class="anchor" aria-label="anchor" href="#arg-extra-demog"></a></dt>
<dd><p>if should include more indicators from v2.2 report on language etc.</p></dd>


<dt id="arg-need-proximityscore">need_proximityscore<a class="anchor" aria-label="anchor" href="#arg-need-proximityscore"></a></dt>
<dd><p>whether to calculate proximity scores</p></dd>


<dt id="arg-infer-sitepoints">infer_sitepoints<a class="anchor" aria-label="anchor" href="#arg-infer-sitepoints"></a></dt>
<dd><p>set to TRUE to try to infer the lat,lon of each site around which the blocks in sites2blocks were found.
lat,lon of each site will be approximated as average of nearby blocks,
although a more accurate slower way would be to use reported distance of each of 3 of the furthest block points and triangulate</p></dd>


<dt id="arg-need-blockwt">need_blockwt<a class="anchor" aria-label="anchor" href="#arg-need-blockwt"></a></dt>
<dd><p>if fips parameter is used, passed to <code><a href="getblocksnearby_from_fips.html">getblocksnearby_from_fips()</a></code></p></dd>


<dt id="arg-thresholds">thresholds<a class="anchor" aria-label="anchor" href="#arg-thresholds"></a></dt>
<dd><p>list of percentiles like list(80,90) passed to
batch.summarize(), to be
counted to report how many of each set of indicators exceed thresholds
at each site. (see default)</p></dd>


<dt id="arg-threshnames">threshnames<a class="anchor" aria-label="anchor" href="#arg-threshnames"></a></dt>
<dd><p>list of groups of variable names (see default)</p></dd>


<dt id="arg-threshgroups">threshgroups<a class="anchor" aria-label="anchor" href="#arg-threshgroups"></a></dt>
<dd><p>list of text names of the groups (see default)</p></dd>


<dt id="arg-updateprogress">updateProgress<a class="anchor" aria-label="anchor" href="#arg-updateprogress"></a></dt>
<dd><p>progress bar function passed to <code><a href="doaggregate.html">doaggregate()</a></code> in shiny app</p></dd>


<dt id="arg-updateprogress-getblocks">updateProgress_getblocks<a class="anchor" aria-label="anchor" href="#arg-updateprogress-getblocks"></a></dt>
<dd><p>progress bar function passed to <code><a href="getblocksnearby.html">getblocksnearby()</a></code> in shiny app</p></dd>


<dt id="arg-in-shiny">in_shiny<a class="anchor" aria-label="anchor" href="#arg-in-shiny"></a></dt>
<dd><p>if fips parameter is used, passed to <code><a href="getblocksnearby_from_fips.html">getblocksnearby_from_fips()</a></code></p></dd>


<dt id="arg-quiet">quiet<a class="anchor" aria-label="anchor" href="#arg-quiet"></a></dt>
<dd><p>Optional. set to TRUE to avoid message about using <code><a href="getblocks_diagnostics.html">getblocks_diagnostics()</a></code>,
which is relevant only if a user saved the output of this function.</p></dd>


<dt id="arg-parallel">parallel<a class="anchor" aria-label="anchor" href="#arg-parallel"></a></dt>
<dd><p>whether to use parallel processing in <code><a href="getblocksnearby.html">getblocksnearby()</a></code>, but not implemented yet.</p></dd>


<dt id="arg-silentinteractive">silentinteractive<a class="anchor" aria-label="anchor" href="#arg-silentinteractive"></a></dt>
<dd><p>to prevent long output showing in console in RStudio when in interactive mode,
passed to <code><a href="doaggregate.html">doaggregate()</a></code> also. app server sets this to TRUE when calling doaggregate() but
<code>ejamit()</code> default is to set this to FALSE when calling <code><a href="doaggregate.html">doaggregate()</a></code>.</p></dd>


<dt id="arg-called-by-ejamit">called_by_ejamit<a class="anchor" aria-label="anchor" href="#arg-called-by-ejamit"></a></dt>
<dd><p>Set to TRUE by <code>ejamit()</code> to suppress some outputs even if ejamit(silentinteractive=F)</p></dd>


<dt id="arg-testing">testing<a class="anchor" aria-label="anchor" href="#arg-testing"></a></dt>
<dd><p>used while testing this function</p></dd>


<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
<dd><p>passed to <code><a href="getblocksnearby.html">getblocksnearby()</a></code> etc. such as  report_progress_every_n = 0</p></dd>

</dl></div>
    <div class="section level2">
    <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
    <p>A list of tables of results:</p><ul><li><p><strong>results_overall</strong>  a data.table with one row that provides the summary across all sites, the aggregated results for all unique residents.</p></li>
<li><p><strong>results_bysite</strong>   results for individual sites (buffers) - a data.table of results,
one row per ejam_uniq_id (i.e., each site analyzed), one column per indicator</p></li>
<li><p><strong>results_bybg_people</strong>  results for each block group, to allow for showing the distribution of each
indicator across everyone within each demographic group.</p></li>
<li><p><strong>longnames</strong>  descriptive long names for the indicators in the above outputs</p></li>
<li><p><strong>count_of_blocks_near_multiple_sites</strong>  additional detail</p></li>
<li><p><strong>sitetype</strong> indicates if analysis used latlon, fips, or shp</p></li>
</ul></div>
    <div class="section level2">
    <h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
    <p>See examples in vignettes/ articles at https://usepa.github.io/EJAM/index.html</p>
    </div>
    <div class="section level2">
    <h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2>
    <div class="dont-index"><p><code><a href="getblocksnearby.html">getblocksnearby()</a></code> <code><a href="doaggregate.html">doaggregate()</a></code></p></div>
    </div>

    <div class="section level2">
    <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span></span>
<span><span class="co"># See examples in vignettes/ articles at https://usepa.github.io/EJAM/index.html</span></span>
<span></span>
<span> <span class="co"># All in one step, using functions not shiny app:</span></span>
<span> <span class="va">out</span> <span class="op">&lt;-</span> <span class="fu">ejamit</span><span class="op">(</span><span class="va">testpoints_100_dt</span>, <span class="fl">2</span><span class="op">)</span></span>
<span></span>
<span> <span class="kw">if</span> <span class="op">(</span><span class="cn">FALSE</span><span class="op">)</span> <span class="op">{</span> <span class="co"># \dontrun{</span></span>
<span> <span class="co"># Do not specify sitepoints and it will prompt you for a file,</span></span>
<span> <span class="co"># if in RStudio in interactive mode!</span></span>
<span> <span class="va">out</span> <span class="op">&lt;-</span> <span class="fu">ejamit</span><span class="op">(</span>radius <span class="op">=</span> <span class="fl">3</span><span class="op">)</span></span>
<span></span>
<span>  <span class="co"># Specify facilities or sites as points for test data,</span></span>
<span>  <span class="co"># use 1000 test facility points from the R package</span></span>
<span>  <span class="va">testsites</span> <span class="op">&lt;-</span> <span class="va">testpoints_1000</span></span>
<span>  <span class="co"># use facility points in an excel or csv file</span></span>
<span>   <span class="va">testsites</span> <span class="op">&lt;-</span> <span class="fu"><a href="latlon_from_anything.html">latlon_from_anything</a></span><span class="op">(</span></span>
<span>     <span class="fu"><a href="https://rdrr.io/r/base/system.file.html" class="external-link">system.file</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/paste.html" class="external-link">paste0</a></span><span class="op">(</span><span class="st">"testdata/latlon/"</span>,</span>
<span>      <span class="st">"testpoints_10.xlsx"</span><span class="op">)</span>,</span>
<span>    package <span class="op">=</span> <span class="st">"EJAM"</span><span class="op">)</span></span>
<span>    <span class="op">)</span></span>
<span>   <span class="co"># head(testsites)</span></span>
<span>  <span class="co"># use facility points from a random sample of EPA-regulated facilities</span></span>
<span>  <span class="va">testsites</span> <span class="op">&lt;-</span> <span class="fu"><a href="testpoints_n.html">testpoints_n</a></span><span class="op">(</span><span class="fl">1e3</span><span class="op">)</span></span>
<span></span>
<span>  <span class="co"># Specify max distance from sites to look at (residents within X miles of site point)</span></span>
<span>  <span class="va">radius</span> <span class="op">&lt;-</span> <span class="fl">3.1</span> <span class="co"># miles</span></span>
<span></span>
<span>  <span class="co"># Get summaries of all indicators near a set of points</span></span>
<span>  <span class="va">out</span> <span class="op">&lt;-</span> <span class="fu">ejamit</span><span class="op">(</span><span class="va">testsites</span>, <span class="va">radius</span><span class="op">)</span></span>
<span>  <span class="co"># out &lt;- ejamit("myfile.xlsx", 3.1)</span></span>
<span></span>
<span>  <span class="co"># out2 &lt;- ejscreenit(testpoints_5)</span></span>
<span></span>
<span>  <span class="co"># View results overall</span></span>
<span>  <span class="fu"><a href="https://rdrr.io/r/base/Round.html" class="external-link">round</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/t.html" class="external-link">t</a></span><span class="op">(</span><span class="va">out</span><span class="op">$</span><span class="va">results_overall</span><span class="op">)</span>, <span class="fl">3.1</span><span class="op">)</span></span>
<span></span>
<span>  <span class="co"># View plots</span></span>
<span>   <span class="fu">plot_distance_by_group</span><span class="op">(</span>results_bybg_people <span class="op">=</span> <span class="va">out</span><span class="op">$</span><span class="va">results_bybg_people</span><span class="op">)</span></span>
<span>   <span class="fu">distance_by_group</span><span class="op">(</span><span class="va">out</span><span class="op">$</span><span class="va">results_bybg_people</span><span class="op">)</span></span>
<span></span>
<span>  <span class="co"># View maps</span></span>
<span>  <span class="fu"><a href="mapfast.html">mapfast</a></span><span class="op">(</span><span class="va">out</span><span class="op">$</span><span class="va">results_bysite</span>, radius <span class="op">=</span> <span class="fl">3.1</span><span class="op">)</span></span>
<span></span>
<span>  <span class="co"># view results at a single site</span></span>
<span>  <span class="fu"><a href="mapfast.html">mapfast</a></span><span class="op">(</span><span class="va">out</span><span class="op">$</span><span class="va">results_bysite</span>, radius <span class="op">=</span> <span class="fl">3.1</span><span class="op">)</span></span>
<span>  <span class="co"># all the raw numbers at one site</span></span>
<span>  <span class="fu"><a href="https://rdrr.io/r/base/t.html" class="external-link">t</a></span><span class="op">(</span><span class="va">out</span><span class="op">$</span><span class="va">results_bysite</span><span class="op">[</span><span class="fl">1</span>, <span class="op">]</span><span class="op">)</span></span>
<span></span>
<span>  <span class="co"># if doing just 1st step of ejamit()</span></span>
<span>  <span class="co">#  get distance between each site and every nearby Census block</span></span>
<span></span>
<span>  <span class="va">s2b</span> <span class="op">&lt;-</span> <span class="va">testoutput_getblocksnearby_100pts_1miles</span></span>
<span>  <span class="fu"><a href="getblocks_diagnostics.html">getblocks_diagnostics</a></span><span class="op">(</span><span class="va">s2b</span><span class="op">)</span></span>
<span></span>
<span>  <span class="va">testsites</span> <span class="op">&lt;-</span> <span class="va">testpoints_10</span><span class="op">[</span><span class="fl">2</span>,<span class="op">]</span></span>
<span>  <span class="va">s2b</span> <span class="op">&lt;-</span> <span class="fu"><a href="getblocksnearby.html">getblocksnearby</a></span><span class="op">(</span><span class="va">testsites</span>, radius <span class="op">=</span> <span class="fl">3.1</span><span class="op">)</span></span>
<span>  <span class="fu"><a href="getblocks_diagnostics.html">getblocks_diagnostics</a></span><span class="op">(</span><span class="va">s2b</span><span class="op">)</span></span>
<span>  <span class="fu"><a href="plotblocksnearby.html">plotblocksnearby</a></span><span class="op">(</span><span class="va">s2b</span><span class="op">)</span></span>
<span></span>
<span>  <span class="co"># if doing just 2d step of ejamit()</span></span>
<span>  <span class="co">#  get summaries of all indicators based on table of distances</span></span>
<span>  <span class="va">out</span> <span class="op">&lt;-</span> <span class="fu"><a href="doaggregate.html">doaggregate</a></span><span class="op">(</span><span class="va">s2b</span>, <span class="va">testsites</span><span class="op">)</span> <span class="co"># this works now and is simpler</span></span>
<span></span>
<span><span class="op">}</span> <span class="co"># }</span></span></code></pre></div>
    </div>
  </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
    </nav></aside></div>


    <footer><div class="pkgdown-footer-left">
  <p>US EPA 2024</p>
</div>

<div class="pkgdown-footer-right">
  <p>EJAM Version 2.32.0</p>
</div>

    </footer></div>





  </body></html>

